
import fetcher from '../common/fetch';

export const articleUrl = '/article';

export const register = body =>
    fetcher('/user/register', {
        method: 'POST',
        body
    });

export const login = body =>
    fetcher('/user/login', {
        method: 'POST',
        body
    });

export const addArticle = body =>
    fetcher('/article/add', {
        method: 'POST',
        body
    });

export const getArticle = () =>
    fetcher('/article/list');

export const deleteArticle = id =>
    fetcher(`/article/delete/${id}`, {
        method: 'DELETE',
    });